Prevent calculation on MD5 when 'safe' is not set

When 'safe' flag is not set, MD5 sum shouldn't be calculated. Especially on the server, because it does one more query which the user can try to prevent.