So, for a bug in the 1.13_alpha baselayout ebuild I got hosts, networks, rc.conf and a few other files in /etc/env.d rather than /etc. At that point eselect env update started to loop indefinitely writing nonsense data into /etc/profile.env.
Fixed as of eselect-1.0.6.