Explaining dark matter and B decay anomalies with an Lμ − Lτ model