Constraining the solar neighbourhood age–metallicity relation from white dwarf–main sequence binaries