Implement a small command-line tool in Python called `logtally`.

Requirements:
- It reads newline-delimited JSON log records from stdin. Each record has `ts` (ISO-8601 string), `level` (one of DEBUG, INFO, WARN, ERROR), `service` (string), and optional `latency_ms` (number).
- It prints, per service, the count of records by level and the p50 and p95 of `latency_ms` (ignore records without latency).
- Malformed lines must be counted and reported at the end, never crash the program.
- Support a `--since <ISO timestamp>` flag that drops earlier records.
- Use only the standard library.

After the code, explain in two or three sentences how you computed percentiles and why you chose that method, then list three edge cases a unit test suite should cover.