Fix a dynamic borrow error when executing timer callbacks.

r? @metajack