proc: clean up and fix /proc/<pid>/mem handling