Nanoscale luminescence spectroscopy of defects at buried interfaces and ultrathin films