Implementation of Realm.cancelTransaction

It can be very useful to be able to cancel/abort a write transaction. This is a simple implementation of `Realm.cancelTransaction()`.

@bmunkholm @emanuelez 
Maybe rename this to ```rollbackAndContinueAsRead```to align the naming with the ```commitAndContinueAsRead```.