Fix bug in constant propagation.

Functions with global effects were not considered const.
Intrinsics had a global side effect by default.