A pilot scheme to hold trials for serious sexual offences without a jury is to be scrapped by the Scottish government.