The UK government says it is considering changing the law around defendants who are considered unfit to stand trial.