Improve inference in monadic code

This makes unification treat global metavariables the same way as local
metavariables. Maybe be slightly dubious if the metavariable is not
intended for type inference...