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