making mkGhcjsOutput safe

tail fails on an empty list, which means that mkGhcjsOutput might have
been failing on files without extensions