The 17 MeV Anomaly in Beryllium Decays and $U(1)$ Portal to Dark Matter